package org.aurora.common.util;

public class UUIDUtil {
    /**
     * {时间戳}_{ip}_{进程id}_{线程id}
     */
    private final static String UUID_FORMAT = "%s_%s_%s_%s";

    public final static String uuid() {
        String ipAddress = NetworkUtil.getIpAddress();
        String processId = RuntimeUtil.processId();
        long threadId = Thread.currentThread().getId();
        long currentTimeMillis = SystemTimeUtil.currentTimeMillis();

        return String.format(UUID_FORMAT, currentTimeMillis, ipAddress, processId, threadId);
    }
}
